<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>PluginStartupInfo</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>
<body>

<h1>PluginStartupInfo</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a  href="index.html">structures</a>
</div>

<div class=shortdescr>
The <dfn>PluginStartupInfo</dfn> structure is used in the <a href="../exported_functions/setstartupinfo.html">SetStartupInfo</a>
function to pass various important information to the plugin.
</div>

<pre class=syntax>
struct PluginStartupInfo
{
  int StructSize;

  char ModuleName[NM];
  int ModuleNumber;
  const char *RootKey;
  FARAPIMENU             Menu;
  FARAPIDIALOG           Dialog;
  FARAPIMESSAGE          Message;
  FARAPIGETMSG           GetMsg;
  FARAPICONTROL          Control;
  FARAPISAVESCREEN       SaveScreen;
  FARAPIRESTORESCREEN    RestoreScreen;
  FARAPIGETDIRLIST       GetDirList;
  FARAPIGETPLUGINDIRLIST GetPluginDirList;
  FARAPIFREEDIRLIST      FreeDirList;

  // <em>FAR &gt;= 1.50</em>
  FARAPIVIEWER           Viewer;
  FARAPIEDITOR           Editor;
  FARAPICMPNAME          CmpName;

  // <em>FAR &gt;= 1.52</em>
  FARAPICHARTABLE        CharTable;
  FARAPITEXT             Text;

  // <em>FAR &gt;= 1.60</em>
  FARAPIEDITORCONTROL    EditorControl;

  // <em>FAR &gt;= 1.70</em>
  FARSTANDARDFUNCTIONS  *FSF;

  FARAPISHOWHELP         ShowHelp;
  FARAPIADVCONTROL       AdvControl;
  FARAPIINPUTBOX         InputBox;
  FARAPIDIALOGEX         DialogEx;
  FARAPISENDDLGMESSAGE   SendDlgMessage;
  FARAPIDEFDLGPROC       DefDlgProc;
  DWORD_PTR              Reserved;
  FARAPIVIEWERCONTROL    ViewerControl;
};
</pre>
<h3>Elements</h3>
<div class=descr>

    <div class=dfn>StructSize</div>
    <div class=dfndescr>Structure size. If new fields are added, this field will allow detection of
         the version of the structure used.</div>
    <div class=dfn>ModuleName</div>
    <div class=dfndescr>Full name with path of the plugin module.</div>
    <div class=dfn>ModuleNumber</div>
    <div class=dfndescr>Number of the plugin module. Passed as parameter in some functions.</div>
    <div class=dfn>RootKey</div>
    <div class=dfndescr>Registry root key, where plugins can save their parameters.
    Valid both for <b>HKEY_CURRENT_USER</b> and <b>HKEY_LOCAL_MACHINE</b>.
      Usually it is "<code>Software\Far\Plugins</code>", but you must not specify this
      string directly, because it can be changed or can become optional in future.
      For example, if FAR is started with
      '<code>/u user1</code>' command line parameter, <em>RootKey</em> will
      contain "<code>Software\Far\Users\user1\Plugins</code>".
      <p>Do not save parameters directly in the <i>RootKey</i>, create your own subkey here.</div>
    <div class=dfn>Menu</div>
    <div class=dfndescr>Address of the <a href="../service_functions/menu.html">Menu</a> function.</div>
    <div class=dfn>Dialog</div>
    <div class=dfndescr>Address of the <a href="../dialogapi/dialog.html">Dialog</a> function.</div>
    <div class=dfn>Message</div>
    <div class=dfndescr>Address of the <a href="../service_functions/message.html">Message</a> function.</div>
    <div class=dfn>GetMsg</div>
    <div class=dfndescr>Address of the <a href="../service_functions/getmsg.html">GetMsg</a> function.</div>
    <div class=dfn>Control</div>
    <div class=dfndescr>Address of the <a href="../service_functions/control.html">Control</a> function.</div>
    <div class=dfn>SaveScreen</div>
    <div class=dfndescr>Address of the <a href="../service_functions/savescreen.html">SaveScreen</a> function.</div>
    <div class=dfn>RestoreScreen</div>
    <div class=dfndescr>Address of the <a href="../service_functions/restorescreen.html">RestoreScreen</a> function.</div>
    <div class=dfn>GetDirList</div>
    <div class=dfndescr>Address of the <a href="../service_functions/getdirlist.html">GetDirList</a> function.</div>
    <div class=dfn>GetPluginDirList</div>
    <div class=dfndescr>Address of the <a href="../service_functions/getplugindirlist.html">GetPluginDirList</a> function.</div>
    <div class=dfn>FreeDirList</div>
    <div class=dfndescr>Address of the <a href="../service_functions/freedirlist.html">FreeDirList</a> function.</div>

    <div class=dfn>Viewer</div>
    <div class=dfndescr>Address of the <a href="../service_functions/viewer.html">Viewer</a> function.</div>
    <div class=dfn>Editor</div>
    <div class=dfndescr>Address of the <a href="../service_functions/editor.html">Editor</a> function.</div>
    <div class=dfn>CmpName</div>
    <div class=dfndescr>Address of the <a href="../service_functions/cmpname.html">CmpName</a> function.</div>

    <div class=dfn>CharTable</div>
    <div class=dfndescr>Address of the <a href="../service_functions/chartable.html">CharTable</a> function.</div>
    <div class=dfn>Text</div>
    <div class=dfndescr>Address of the <a href="../service_functions/text.html">Text</a> function.</div>
    <div class=dfn>EditorControl</div>
    <div class=dfndescr>Address of the <a href="../service_functions/editorcontrol.html">EditorControl</a> function.</div>

    <div class=dfn>FSF</div>
    <div class=dfndescr>Pointer to the <a href="../fsf/index.html">FarStandardFunctions</a> structure, which contains addresses of useful functions from far.exe.</div>
    <div class=dfn>ShowHelp</div>
    <div class=dfndescr>Address of the <a href="../service_functions/showhelp.html">ShowHelp</a>.</div>
    <div class=dfn>AdvControl</div>
    <div class=dfndescr>Address of the <a href="../service_functions/advcontrol.html">AdvControl</a>.</div>
    <div class=dfn>InputBox</div>
    <div class=dfndescr>Address of the <a href="../service_functions/inputbox.html">InputBox</a>.</div>
    <div class=dfn>DialogEx</div>
    <div class=dfndescr>Address of the <a href="../dialogapi/dialogex.html">DialogEx</a>.</div>
    <div class=dfn>SendDlgMessage</div>
    <div class=dfndescr>Address of the <a href="../dialogapi/senddlgmessage.html">SendDlgMessage</a>.</div>
    <div class=dfn>DefDlgProc</div>
    <div class=dfndescr>Address of the <a href="../dialogapi/defdlgproc.html">DefDlgProc</a>.</div>
    <div class=dfn>DefDlgProc</div>
    <div class=dfndescr>Address of the <a href="../service_functions/viewercontrol.html">ViewerControl</a>.</div>
</div>

<h3>Remarks</h3>
<div class=descr>
  FAR Manager versions:<ul>
  <li>below 1.50 (with plugins support) - do not contain fields after <a href="../service_functions/freedirlist.html">FreeDirList</a>;
  <li>below 1.52 - do not contain fields after <a href="../service_functions/cmpname.html">CmpName</a>;
  <li>below 1.60 - do not contain fields after <a href="../service_functions/text.html">Text</a>;
  <li>below 1.65 - do not contain fields after <a href="../service_functions/editorcontrol.html">EditorControl</a>
  </ul>
  So, if you intend to use
  <a href="../service_functions/viewer.html">Viewer</a> or
  <a href="../service_functions/editor.html">Editor</a> functions
  or any other function after these, you should first check the <i>StructSize</i> field,
  to determine if the required function is present in the running FAR version.
</div>

<div class=see>See also:</div><div class=seecont>
<a href="index.html">structures</a> |
<a href="../delphi/tpluginstartupinfo.html">TPluginStartupInfo</a>
</div>

</body>
</html>